package com.hqyj.bigdata_project.controller;

import com.hqyj.bigdata_project.json.R;
import com.hqyj.bigdata_project.service.CatalogVideoTopTenInfoService;
import com.hqyj.bigdata_project.view.CatalogVideoTopTenView;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("catalogvideo")
public class CatalogVideoInfoController {

    @Resource
    private CatalogVideoTopTenInfoService catalogVideoTopTenInfoService;


    @GetMapping("/topTen")
    public R queryCatalogVideoTopTenViewsList(){
        try{
            CatalogVideoTopTenView catalogVideoTopTenView = catalogVideoTopTenInfoService.initCatalogVideoTopTenView();
            return R.success("查询板块视频播放量前十名列表成功！",catalogVideoTopTenView);
        }catch (Exception ex){
            return R.error("程序出现异常！");
        }
    }
}
